package com.xianniu.ltc.mapper;

import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xianniu.ltc.model.entity.TRbhetong0DTO;
import com.xianniu.ltc.model.entity.TRbshangji4DTO;
import com.xianniu.ltc.model.po.report.ReportLeadPO;
import com.xianniu.ltc.model.vo.statistics.ShangJiStatisticsVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * 商机
 */
@Mapper
public interface TRbshangji4Mapper extends BaseMapper<TRbshangji4DTO> {

    /**
     * 商机新增-按周
     * @param po
     * @return
     */
    List<ShangJiStatisticsVo> queryNowYearShangJiByWeek(@Param("po") ReportLeadPO po, @Param("weekList") int[] weekList);

    /**
     * 商机新增-按月
     * @param po
     * @return
     */
    List<ShangJiStatisticsVo> queryNowYearShangJiByMonth(@Param("po") ReportLeadPO po);

    /**
     * 按年统计
     * @param po
     * @return
     */
    List<ShangJiStatisticsVo> queryNowYearShangJiByYear(@Param("po") ReportLeadPO po);

    /**
     * 按起止时间
     * @param po
     * @return
     */
    List<ShangJiStatisticsVo> queryNowYearShangJiByStartAndEndTime(@Param("po") ReportLeadPO po );

    /**
     *
     * @param po
     * @return
     */
    List<ShangJiStatisticsVo> queryNowYearShangJiByIndustry(@Param("po") ReportLeadPO po );

    /**
     * @description
     * @author MengGang
     * @return Integer
     * @param tenantCode String
     * @param rbShangJi4_id String
     */
    @InterceptorIgnore(tenantLine = "on")
    Integer queryShangJiCount(@Param("tenantCode") String tenantCode, @Param("rbShangJi4_id") String rbShangJi4_id);

    /**
     * 功能描述: 售前协同审批通过，同步商机关联售前协同，报价含税，报价未税，综合税率字段
     *
     * @Param: [guanlianshangji, shouQianId, baojiajinehanshui, baojiajineweishui, zongheshuilv]
     * @Return: java.lang.Integer
     * @Author: wrj
     * @Date: 2022/10/20 下午3:23
     * @Version 1.0.0
     */
    Integer updateSjByPreSalesSynergyInfo(String guanlianshangji, String shouQianId, BigDecimal baojiajinehanshui, BigDecimal baojiajineweishui, BigDecimal zongheshuilv);
}
